import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  // 1.state:负责存储数据
  state: {
    userInfo: {}
  },
  // 2.mutations:复制修改数据
  mutations: {
    updateUserInfo (state, newValue) {
      state.userInfo = newValue
    }
  },
  // 3.actions:异步提交数据
  actions: {},
  // 4.vuex模块化
  modules: {}
})
